<!doctype html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport"
        content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>Document</title>
  <style>
    body {
      font-family: Arial, sans-serif;
      margin: 0;
      padding: 0;
    }
    .overlay {
      position: fixed;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
      background-color: rgba(0, 0, 0, 0.5);
      display: flex;
      align-items: center;
      justify-content: center;
    }
    .modal {
      background-color: #fff;
      padding: 20px;
      border-radius: 5px;
      box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
      max-width: 400px;
      text-align: center;
    }
    .modal h2 {
      margin-top: 0;
    }
    .modal p {
      margin-bottom: 20px;
    }
    .modal button {
      background-color: #333;
      color: #fff;
      padding: 10px 20px;
      border: none;
      border-radius: 5px;
      cursor: pointer;
    }
  </style>
</head>
<body>
<div class="overlay">
  <div class="modal">
    <h2>欢迎访问我们的网站</h2>
    <p>这是一个页面弹窗的示例</p>
    <button onclick="closeModal()">关闭</button>
  </div>
</div>

<script>
  function closeModal() {
    let overlay = document.querySelector('.overlay');
    overlay.style.display = 'none';
  }
</script>
</body>
</html>
